﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using CarCrash.Application.Drawing.entities.Forms;

namespace CarCrash.Application.Drawing.entities
{

    public class Line : DrawableEntity
    {

        private Color color;
        private int thickness;

        public Color Color 
        {
            get { return color; }
            set { color = value; pen = new Pen(color, thickness); } 
        }
        public int Thickness 
        {
            get { return thickness; } 
            set { thickness = value; pen = new Pen(color, thickness); } 
        }

        private Pen pen;

        public Line()
        {
            Color = Color.Black;
            Thickness = 1;
            pen = new Pen(Color, Thickness);
        }

        public override void Paint(Graphics g)
        {
            g.DrawLine(pen, BeginX, BeginY, EndX, EndY);
        }

        public override System.Windows.Forms.Form GetForm()
        {
            return new LineForm(this);
        }

    }

}